package concurrent;

public abstract class AbstractJob implements Runnable {

	protected int index;

	private DataCollector dataCollector;

	public AbstractJob(int index , DataCollector dataCollector){
		this.index = index;
		this.dataCollector = dataCollector;
	} 

	public abstract void pre();

	@Override
	public void run(){
		pre();
		int i =0;
		while(++i < 100000){
			dataCollector.add(new IssureData(index + "_" + i ,Thread.currentThread().getId()+""));
		}
		done();
	}

	public abstract void done();

}
